package com.gec.anan.dispatch.client;

import com.gec.anan.common.result.Result;
import com.gec.anan.model.vo.dispatch.NewOrderTaskVo;
import com.gec.anan.model.vo.order.NewOrderDataVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


@FeignClient(value = "service-dispatch", path ="/dispatch/newOrder")
public interface NewOrderFeignClient {

    /**
     * 添加并开始新订单任务调度
     * @param newOrderTaskVo
     * @return
     */
    @PostMapping("/addAndStartTask")
    public Result<Long> addAndStartTask(@RequestBody NewOrderTaskVo newOrderTaskVo);

    /**
     * 清空新订单队列数据
     * @param driverId
     * @return
     */
    @GetMapping("/clearNewOrderQueueData/{driverId}")
    public Result<Boolean> clearNewOrderQueueData(@PathVariable Long driverId);

    /**
     * 查询司机新订单信息
     * @param driverId
     * @return
     */
    @GetMapping("/findNewOrderQueueData/{driverId}")
    public Result<List<NewOrderDataVo>> findNewOrderQueueData(@PathVariable Long driverId);
}